import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    // 包含底部导航的
    {
      path: '/',
      redirect: '/home',
      name: 'main-layout',
      component: () => import('./views/layout/main-layout.vue').then(m => m.default),
      children: [
        {
          path: '/home',
          name: 'home',
          component: () => import('./views/home/home.vue').then(m => m.default)
        },
        {
          path: '/friends',
          name: 'friends',
          component: () => import('./views/home/friends.vue').then(m => m.default)
        },
        {
          path: '/group',
          name: 'group',
          component: () => import('./views/home/group.vue').then(m => m.default)
        },
        {
          path: '/user',
          name: 'user',
          component: () => import('./views/user/user.vue').then(m => m.default)
        }
      ]
    },
    // 没有底部导航的
    {
      path: '/',
      redirect: '/home',
      name: 'child-layout',
      component: () => import('./views/layout/child-layout.vue').then(m => m.default),
      children: [
        {
          path: '/friendDetail/:id',
          name: 'friendDetail',
          component: () => import('./views/friend/friendDetail.vue').then(m => m.default)
        },
        {
          path: '/friendSetting/:id',
          name: 'friendSetting',
          component: () => import('./views/friend/friendSetting.vue').then(m => m.default)
        },
        {
          path: '/setRemarks/:id',
          name: 'setRemarks',
          component: () => import('./views/friend/setRemarks.vue').then(m => m.default)
        },
        {
          path: '/chat/:id',
          name: 'chat',
          component: () => import('./views/chat/chat.vue').then(m => m.default)
        },
        {
          path: '/groupChat/:id',
          name: 'groupChat',
          component: () => import('./views/chat/groupChat.vue').then(m => m.default)
        },
        {
          path: '/addFriend',
          name: 'addFriend',
          component: () => import('./views/friend/addFriend.vue').then(m => m.default)
        },
        {
          path: '/chatSetting/:id',
          name: 'chatSetting',
          component: () => import('./views/chat/chatSetting.vue').then(m => m.default)
        },
        {
          path: '/groupSetting/:id',
          name: 'groupSetting',
          component: () => import('./views/chat/groupSetting.vue').then(m => m.default)
        },
        {
          path: '/selectFriend/:id',
          name: 'selectFriend',
          component: () => import('./views/chat/selectFriend.vue').then(m => m.default)
        },
        {
          path: '/groupSelect/:id',
          name: 'groupSelect',
          component: () => import('./views/chat/groupSelect.vue').then(m => m.default)
        },
        {
          path: '/groupQrcode/:id',
          name: 'groupQrcode',
          component: () => import('./views/chat/groupQrcode.vue').then(m => m.default)
        },
        {
          path: '/userEdit',
          name: 'userEdit',
          component: () => import('./views/user/userEdit.vue').then(m => m.default)
        },
        {
          path: '/editUserMsg',
          name: 'editUserMsg',
          component: () => import('./views/user/editUserMsg.vue').then(m => m.default)
        },
        {
          path: '/editAvatar',
          name: 'editAvatar',
          component: () => import('./views/user/editAvatar.vue').then(m => m.default)
        },
        {
          path: '/userSetting',
          name: 'userSetting',
          component: () => import('./views/user/userSetting.vue').then(m => m.default)
        },
        {
          path: '/messageNotification',
          name: 'messageNotification',
          component: () => import('./views/user/messageNotification.vue').then(m => m.default)
        },
        {
          path: '/privacy',
          name: 'privacy',
          component: () => import('./views/user/privacy.vue').then(m => m.default)
        },
        {
          path: '/transaction',
          name: 'transaction',
          component: () => import('./views/user/transaction.vue').then(m => m.default)
        },
        {
          path: '/storageSpace',
          name: 'storageSpace',
          component: () => import('./views/user/storageSpace.vue').then(m => m.default)
        },
        {
          path: '/about',
          name: 'about',
          component: () => import('./views/user/about.vue').then(m => m.default)
        },
        {
          path: '/addFriendList',
          name: 'addFriendList',
          component: () => import('./views/friend/addFriendList.vue').then(m => m.default)
        },
        {
          path: '/sureFriend/:id',
          name: 'sureFriend',
          component: () => import('./views/friend/sureFriend.vue').then(m => m.default)
        }
      ]
    }
  ]
})
